
import React from 'react'
import { Route, Link, HashRouter as Router } from 'react-router-dom';
import Home from '../Home/index';
let Login = React.lazy(() => import('@/Pages/Login'))
let Page404 = React.lazy(() => import('@/Pages/Page404'))
let Product = React.lazy(() => import('@/Pages/Product'))
let Category = React.lazy(() => import('@/Pages/Product/Category'))
let ProductList = React.lazy(() => import('@/Pages/Product/ProductList'))
let PayManagerment = React.lazy(() => import('@/Pages/PayManagerment'))
let PayType = React.lazy(() => import('@/Pages/PayManagerment/PayType'))
let PictureManagerment = React.lazy(() => import('@/Pages/PictureManagerment'))
let CarsouelManagerment = React.lazy(() => import('@/Pages/PictureManagerment/CarsouelManagerment'))
let TransactionManagerment = React.lazy(() => import('@/Pages/TransactionManagerment'))
let Amount = React.lazy(() => import('@/Pages/TransactionManagerment/Amount'))
let Order = React.lazy(() => import('@/Pages/TransactionManagerment/Order'))
let Refund = React.lazy(() => import('@/Pages/TransactionManagerment/Refund'))
let Content = React.lazy(() => import('@/Home/content'))
const routes = [
    {
        path: "/login",
        element: <Login />
    },
    {
        path: "/Page404",
        element: <Page404 />
    },
    {

        path: "/",
        // element:<Home />,
        element: <Content />,
        children: [
            {
                path: "product",
                element: <Product />,
                label: "商品管理",
                key: 'product',
                children: [
                    {
                        path: "productList",
                        element: <ProductList />,
                        label: '产品列表',
                        key: 'productList',
                    },
                    {
                        path: "category",
                        element: <Category />,
                        label: '产品类目',
                        key: 'category',
                    }
                ]
            },
            {
                path: "payment",
                element: <PayManagerment />,
                label: '支付管理',
                key: 'payment',
                children: [
                    {
                        path: "paytype",
                        element: <PayType />,
                        label: '支付类型',
                        key: 'paytype',
                    }
                ]
            },
            {
                path: "picture",
                element: <PictureManagerment />,
                label: '图片管理',
                key: 'picture',
                children: [
                    {
                        path: 'carousel',
                        element: <CarsouelManagerment />,
                        label: '轮播图管理',
                        key: 'carousel'
                    }
                ]
            },
            {
                path: "transaction",
                element: <TransactionManagerment />,
                label: '交易管理',
                key: 'transaction',
                children: [
                    {
                        path: "amount",
                        element: <Amount />,
                        label: '交易金额',
                        key: 'amount'
                    },
                    {
                        path: 'order',
                        element: <Order />,
                        label: '订单管理',
                        key: 'order'
                    },
                    {
                        path: 'refund',
                        element: <Refund />,
                        label: '退款管理',
                        key: 'refund'
                    }
                ]
            },
        ]
    },
]
export default routes